<div class="batch-info">
  <div>
    <%= render 'collections/form_for_select_collection', user_collections: @user_collections %>
  </div>

  <% if on_my_works? %>
    <div class="batch-toggle">
      <% session[:batch_edit_state] = "on" %>
      <div class="button_to-inline">
        <%= batch_edit_continue "Edit Selected" %>
      </div>
      <%= batch_delete %>
      <%= button_tag "Add to Collection", class: 'btn btn-primary submits-batches submits-batches-add',
          data: { toggle: "modal", target: "#collection-list-container" } %>
    </div>
  <% end %>

  <div class="sort-toggle">
    <% if @response.response['numFound'] > 1 && !sort_fields.empty? %>
      <%= form_tag search_action_for_dashboard, method: :get, class: 'per_page form-inline' do %>
            <div class="form-group">
              <fieldset class="col-xs-12">
                <legend class="sr-only"><%= t('sufia.sort_label') %></legend>
                <%= label_tag(:sort, "<span>Sort By:</span>".html_safe) %>
                <%= select_tag(:sort, options_for_select(sort_fields, h(params[:sort]))) %>
                <%= label_tag :per_page do %>
                    Show <%= select_tag :per_page, options_for_select(['10', '20', '50', '100'], h(params[:per_page])),
                                        title: "Number of results to display per page" %> per page
                <% end %>
                <%= render_hash_as_hidden_fields(search_state.params_for_search.except(:per_page, :sort, :utf8)) %>
                &nbsp;&nbsp;&nbsp;
                <button class="btn btn-info" id="dashboard_sort_submit"><span class="glyphicon glyphicon-refresh"></span>
                  Refresh
                </button>
              </fieldset>
            </div>

      <% end %>
    <% end %>
  </div>

</div>
